<form class="layui-form" lay-filter="form" id="form">
    <div class="layui-form-item">
        <label class="layui-form-label label-required-next">收货人</label>
        <div class="layui-input-inline">
            <input type="text" name="full_name" lay-verify="required" lay-reqText="收货人不能为空" autocomplete="off" class="layui-input">
        </div>
        <label class="layui-form-label label-required-next">电话</label>
        <div class="layui-input-inline">
            <input type="text" name="tel" lay-verify="required" lay-reqText="电话不能为空" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">地区</label>
        <div class="layui-input-inline">
            <select name="prov_id" id="prov_id" lay-filter="prov_id">
            </select>
        </div>
        <div class="layui-input-inline">
            <select name="city_id" id="city_id" lay-filter="city_id">
            </select>
        </div>
        <div class="layui-input-inline">
            <select name="area_id" id="area_id" lay-filter="area_id">
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label label-required-next">详细地址</label>
        <div class="layui-input-block">
            <input type="text" name="address" lay-verify="required" lay-reqText="详细地址不能为空" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否默认</label>
        <div class="layui-input-block">
            <input type="radio" name="default" value="1" title="是" checked lay-verify="required">
            <input type="radio" name="default" value="0" title="否" lay-verify="required">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="hidden" name="id" value="">
            <input type="button" lay-submit lay-filter="form-submit" value="确认" class="layui-btn">
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script type="text/html" template lay-done="layui.data.sendParams(d.params);"></script>
<script src="../../../../layuiadmin/lib/plupload/plupload.full.min.js"></script>
<script src="../../../../layuiadmin/lib/plupload/i18n/zh_CN.js"></script>
<script>
    layui.data.sendParams = function (params) {
        layui.use(['verify'], function () {
            let $ = layui.$,
                form = layui.form,
                common = layui.common;

            //设置默认省市区
            common.set_default_area(params.prov_id, params.city_id, params.area_id);
            //监听省份选择
            form.on('select(prov_id)', function (data) {
                common.get_area('city_id', data.value);
            });
            //监听城市选择
            form.on('select(city_id)', function (data) {
                common.get_area('area_id', data.value);
            });
        });
    };
</script>